require(['./config'],() => {
	require(['header','footer'],() =>{
		class Logn {
			constructor() {
			    this.login()
			}
			login(){
				$('.signnow>input').on('click',() => {
					const name = $('.phonenum>input').val()
					const pwd = $('.password>input').val()
					let userList = localStorage.getItem('userList')
					console.log(pwd,name,userList)
					if(userList){
						userList = JSON.parse(userList)
						const isexist = userList.some(user => {
							return user.name === name && user.pwd === pwd
						})
						if(isexist){
							alert('登录成功，即将返回首页')
							location.href = '/index.html'
						}else{
							alert('用户名或密码错误,请重新输入')
							
						}
					}else{
						alert('改用户不存在,请注册')
						location.href = '/html/signin.html'
					}
				})
			}
		}
		new Logn
	})
})